﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace thailandProject.Models
{
    /// <summary>
    /// Contains the field for searching for a client's name
    /// </summary>
    public class ClientsSearchBar
    {
        [StringLength(100)] //100 because the client's first and last name are 50 each
        [DataType(DataType.Text)]
        [Display(Name = "Name")]
        public string ClientSearchName { get; set; }
    }
    
    /// <summary>
    /// Contains the required fields necessary for creating a new client
    /// </summary>
    public class ClientsRequiredFields
    {
        [Required]
        [StringLength(50)]
        [DataType(DataType.Text)]
        [Display(Name = "First Name")]
        public string ClientFirstName { get; set; }

        [Required]
        [StringLength(50)]
        [DataType(DataType.Text)]
        [Display(Name = "Last Name")]
        public string ClientLastName { get; set; }

        [Required]
        [StringLength(50)]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "E-Mail")]
        public string ClientEmail { get; set; }

        [Required]
        [StringLength(20)]
        [DataType(DataType.Text)]
        [Display(Name = "Phone")]
        public string ClientPhone { get; set; }
    }

    /// <summary>
    /// Contains the fields relating to the reservation portion of the
    /// client page
    /// </summary>
    public class ClientReservationFields
    {
        [StringLength(20)] //Property Name length is 20
        [DataType(DataType.Text)]
        [Display(Name = "Reservation")]
        public string ClientReservation { get; set; }

        //TODO: Figure out how to validate the dates so that "Date" comes before "To"
        [DataType(DataType.Date)]
        [Display(Name = "Date")]
        public string ResStartDate { get; set; }

        [DataType(DataType.Date)]
        [Display(Name = "To")]
        public string ResEndDate { get; set; }

        //The mockup shows only one "Pickup Times" text, so the second field's text is blank
        [DataType(DataType.DateTime)]
        [Display(Name = "Pickup Times")]
        public string ResStartDatePickupTime { get; set; }

        [DataType(DataType.DateTime)]
        [Display(Name = "")]
        public string ResEndDatePickupTime { get; set; }

        //Textareas lack a method of testing the max input, so we'll need to check that with Jscript
        [DataType(DataType.MultilineText)]
        [Display(Name = "Notes")]
        public string ClientNotes { get; set; }
    }

    /// <summary>
    /// Contains fields relating to the accounting information portion
    /// </summary>
    public class ClientAccountingFields
    {
        [DataType(DataType.Currency)]
        [Display(Name = "Quoted Price")]
        public string ResQuotedPrice { get; set; }

        [DataType(DataType.Currency)]
        [Display(Name = "Amount Paid")]
        public string ResAmountPaid { get; set; }

        //I think you set the value for the Balance Due in the controller. Before the
        //ActionResult is passed back to the view, set this value to be the result of\
        //Quoted Price - Amount Paid
        //DO NOT USE EditorFor in code. ONLY USE DisplayFor
        [DataType(DataType.Currency)]
        [Display(Name = "BalanceDue")]
        public string ResBalanceDue { get; set; }
    }
}